<template>
  <div>
    {{ $store.state.count }}
    {{ count }}
    <hr>
    <button @click="$store.commit('add')">点击加 1 </button>
    <button @click="$store.commit('user/add')">点击加 1 </button>
    <svg-icon icon-class="eye" class-name="color-red"></svg-icon>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: 'LearnVuex',
  computed: {
    // ...mapState(['count']),
    ...mapState('user', ['count'])
  }
}
</script>

<style>
  .color-red {
    color: red;
  }
</style>
